/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package EA_Model.IEC61970.Generation.Production.impl;

import EA_Model.IEC61970.Core.impl.CurveImpl;

import EA_Model.IEC61970.Domain.AbsoluteDateTime;
import EA_Model.IEC61970.Domain.Money;

import EA_Model.IEC61970.Generation.Production.ProductionPackage;
import EA_Model.IEC61970.Generation.Production.ShutdownCurve;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Shutdown Curve</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link EA_Model.IEC61970.Generation.Production.impl.ShutdownCurveImpl#getShutdownCost <em>Shutdown Cost</em>}</li>
 *   <li>{@link EA_Model.IEC61970.Generation.Production.impl.ShutdownCurveImpl#getShutdownDate <em>Shutdown Date</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class ShutdownCurveImpl extends CurveImpl implements ShutdownCurve {
	/**
	 * The cached value of the '{@link #getShutdownCost() <em>Shutdown Cost</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getShutdownCost()
	 * @generated
	 * @ordered
	 */
	protected Money shutdownCost;

	/**
	 * The cached value of the '{@link #getShutdownDate() <em>Shutdown Date</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getShutdownDate()
	 * @generated
	 * @ordered
	 */
	protected AbsoluteDateTime shutdownDate;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected ShutdownCurveImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return ProductionPackage.Literals.SHUTDOWN_CURVE;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Money getShutdownCost() {
		if (shutdownCost != null && shutdownCost.eIsProxy()) {
			InternalEObject oldShutdownCost = (InternalEObject)shutdownCost;
			shutdownCost = (Money)eResolveProxy(oldShutdownCost);
			if (shutdownCost != oldShutdownCost) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, ProductionPackage.SHUTDOWN_CURVE__SHUTDOWN_COST, oldShutdownCost, shutdownCost));
			}
		}
		return shutdownCost;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Money basicGetShutdownCost() {
		return shutdownCost;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setShutdownCost(Money newShutdownCost) {
		Money oldShutdownCost = shutdownCost;
		shutdownCost = newShutdownCost;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, ProductionPackage.SHUTDOWN_CURVE__SHUTDOWN_COST, oldShutdownCost, shutdownCost));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public AbsoluteDateTime getShutdownDate() {
		if (shutdownDate != null && shutdownDate.eIsProxy()) {
			InternalEObject oldShutdownDate = (InternalEObject)shutdownDate;
			shutdownDate = (AbsoluteDateTime)eResolveProxy(oldShutdownDate);
			if (shutdownDate != oldShutdownDate) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, ProductionPackage.SHUTDOWN_CURVE__SHUTDOWN_DATE, oldShutdownDate, shutdownDate));
			}
		}
		return shutdownDate;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public AbsoluteDateTime basicGetShutdownDate() {
		return shutdownDate;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setShutdownDate(AbsoluteDateTime newShutdownDate) {
		AbsoluteDateTime oldShutdownDate = shutdownDate;
		shutdownDate = newShutdownDate;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, ProductionPackage.SHUTDOWN_CURVE__SHUTDOWN_DATE, oldShutdownDate, shutdownDate));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case ProductionPackage.SHUTDOWN_CURVE__SHUTDOWN_COST:
				if (resolve) return getShutdownCost();
				return basicGetShutdownCost();
			case ProductionPackage.SHUTDOWN_CURVE__SHUTDOWN_DATE:
				if (resolve) return getShutdownDate();
				return basicGetShutdownDate();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case ProductionPackage.SHUTDOWN_CURVE__SHUTDOWN_COST:
				setShutdownCost((Money)newValue);
				return;
			case ProductionPackage.SHUTDOWN_CURVE__SHUTDOWN_DATE:
				setShutdownDate((AbsoluteDateTime)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case ProductionPackage.SHUTDOWN_CURVE__SHUTDOWN_COST:
				setShutdownCost((Money)null);
				return;
			case ProductionPackage.SHUTDOWN_CURVE__SHUTDOWN_DATE:
				setShutdownDate((AbsoluteDateTime)null);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case ProductionPackage.SHUTDOWN_CURVE__SHUTDOWN_COST:
				return shutdownCost != null;
			case ProductionPackage.SHUTDOWN_CURVE__SHUTDOWN_DATE:
				return shutdownDate != null;
		}
		return super.eIsSet(featureID);
	}

} //ShutdownCurveImpl
